package sis.ra.evaluation;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import sis.ra.utility.Utils;


public class evaluationPrecisionRecallDCG {

	public static HashMap <String, Double> getGroundTruth()
	{
		HashMap <String, Double> gth=new HashMap <String, Double> ();
		String filepath="C:\\Documents and Settings\\I820753\\Desktop\\dataset\\testing company\\groundtruth1.txt";
		String content=Utils.readFile(filepath);
//		System.out.println(content);
		String [] lines=content.split("\n");
		for (int i=0;i<lines.length;i++)
		{
			String term=lines[i].split("\t")[0]+"\t"+lines[i].split("\t")[1];
			Double score=Double.parseDouble(lines[i].split("\t")[2]);
	//		System.out.println(term+"=="+score);
			gth.put(term, score);
		}
		return gth;
	}
	public static void main(String[] args) {
		String filepath="C:\\Documents and Settings\\I820753\\Desktop\\dataset\\testing company\\";//Amazon.com_wiki.score1";
		String evaluatefile="_wiki.score8";//0
		HashMap <String, Double> gth= getGroundTruth();
		ArrayList<String> ranks=new ArrayList<String> ();
		File filepaths=new File(filepath);
		File[] files=filepaths.listFiles();
		/*
		 * overall data statistic
		 * allp5 mean the sum up score for all companies precision at 5
		 * allr5 mean the sum up score for all companies recall at 5
		 * avgp5 mean the average score for all companies precision at 5
		 * avgr5 mean the average score for all companies recall at 5
		 * allop5 mean the sum up score for all old companies precision at 5
		 * allor5 mean the sum up score for all old companies recall at 5
		 * avgop5 mean the average score for all old companies precision at 5
		 * avgor5 mean the average score for all old companies recall at 5
		 * allnp5 mean the sum up score for all new companies precision at 5
		 * allnr5 mean the sum up score for all new companies recall at 5
		 * avgnp5 mean the average score for all new companies precision at 5
		 * avgnr5 mean the average score for all new companies recall at 5
		 */
		Double allp5=0.0; Double allp10=0.0; Double allp20=0.0; Double allp30=0.0;Double allp40=0.0;Double allp50=0.0;Double allp60=0.0;Double allp70=0.0;Double allp80=0.0;Double allp90=0.0;Double allp100=0.0; 
		Double avgp5=0.0; Double avgp10=0.0; Double avgp20=0.0; Double avgp30=0.0;Double avgp40=0.0;Double avgp50=0.0;Double avgp60=0.0;Double avgp70=0.0;Double avgp80=0.0;Double avgp90=0.0;Double avgp100=0.0; 
		Double allr5=0.0; Double allr10=0.0; Double allr20=0.0; Double allr30=0.0;Double allr40=0.0;Double allr50=0.0;Double allr60=0.0;Double allr70=0.0;Double allr80=0.0;Double allr90=0.0;Double allr100=0.0; 
		Double avgr5=0.0; Double avgr10=0.0; Double avgr20=0.0; Double avgr30=0.0;Double avgr40=0.0;Double avgr50=0.0;Double avgr60=0.0;Double avgr70=0.0;Double avgr80=0.0;Double avgr90=0.0;Double avgr100=0.0; 
		Double alldcg5=0.0; Double alldcg10=0.0; Double alldcg20=0.0; Double alldcg30=0.0;Double alldcg40=0.0;Double alldcg50=0.0;Double alldcg60=0.0;Double alldcg70=0.0;Double alldcg80=0.0;Double alldcg90=0.0;Double alldcg100=0.0; 
		Double avgdcg5=0.0; Double avgdcg10=0.0; Double avgdcg20=0.0; Double avgdcg30=0.0;Double avgdcg40=0.0;Double avgdcg50=0.0;Double avgdcg60=0.0;Double avgdcg70=0.0;Double avgdcg80=0.0;Double avgdcg90=0.0;Double avgdcg100=0.0; 

		Double allop5=0.0; Double allop10=0.0; Double allop20=0.0; Double allop30=0.0;Double allop40=0.0;Double allop50=0.0;Double allop60=0.0;Double allop70=0.0;Double allop80=0.0;Double allop90=0.0;Double allop100=0.0; 
		Double avgop5=0.0; Double avgop10=0.0; Double avgop20=0.0; Double avgop30=0.0;Double avgop40=0.0;Double avgop50=0.0;Double avgop60=0.0;Double avgop70=0.0;Double avgop80=0.0;Double avgop90=0.0;Double avgop100=0.0;
		Double allor5=0.0; Double allor10=0.0; Double allor20=0.0; Double allor30=0.0;Double allor40=0.0;Double allor50=0.0;Double allor60=0.0;Double allor70=0.0;Double allor80=0.0;Double allor90=0.0;Double allor100=0.0; 
		Double avgor5=0.0; Double avgor10=0.0; Double avgor20=0.0; Double avgor30=0.0;Double avgor40=0.0;Double avgor50=0.0;Double avgor60=0.0;Double avgor70=0.0;Double avgor80=0.0;Double avgor90=0.0;Double avgor100=0.0;
		Double allodcg5=0.0; Double allodcg10=0.0; Double allodcg20=0.0; Double allodcg30=0.0;Double allodcg40=0.0;Double allodcg50=0.0;Double allodcg60=0.0;Double allodcg70=0.0;Double allodcg80=0.0;Double allodcg90=0.0;Double allodcg100=0.0; 
		Double avgodcg5=0.0; Double avgodcg10=0.0; Double avgodcg20=0.0; Double avgodcg30=0.0;Double avgodcg40=0.0;Double avgodcg50=0.0;Double avgodcg60=0.0;Double avgodcg70=0.0;Double avgodcg80=0.0;Double avgodcg90=0.0;Double avgodcg100=0.0; 

		Double allnp5=0.0; Double allnp10=0.0; Double allnp20=0.0; Double allnp30=0.0;Double allnp40=0.0;Double allnp50=0.0;Double allnp60=0.0;Double allnp70=0.0;Double allnp80=0.0;Double allnp90=0.0;Double allnp100=0.0; 
		Double avgnp5=0.0; Double avgnp10=0.0; Double avgnp20=0.0; Double avgnp30=0.0;Double avgnp40=0.0;Double avgnp50=0.0;Double avgnp60=0.0;Double avgnp70=0.0;Double avgnp80=0.0;Double avgnp90=0.0;Double avgnp100=0.0;
		Double allnr5=0.0; Double allnr10=0.0; Double allnr20=0.0; Double allnr30=0.0;Double allnr40=0.0;Double allnr50=0.0;Double allnr60=0.0;Double allnr70=0.0;Double allnr80=0.0;Double allnr90=0.0;Double allnr100=0.0; 
		Double avgnr5=0.0; Double avgnr10=0.0; Double avgnr20=0.0; Double avgnr30=0.0;Double avgnr40=0.0;Double avgnr50=0.0;Double avgnr60=0.0;Double avgnr70=0.0;Double avgnr80=0.0;Double avgnr90=0.0;Double avgnr100=0.0;
		Double allndcg5=0.0; Double allndcg10=0.0; Double allndcg20=0.0; Double allndcg30=0.0;Double allndcg40=0.0;Double allndcg50=0.0;Double allndcg60=0.0;Double allndcg70=0.0;Double allndcg80=0.0;Double allndcg90=0.0;Double allndcg100=0.0; 
		Double avgndcg5=0.0; Double avgndcg10=0.0; Double avgndcg20=0.0; Double avgndcg30=0.0;Double avgndcg40=0.0;Double avgndcg50=0.0;Double avgndcg60=0.0;Double avgndcg70=0.0;Double avgndcg80=0.0;Double avgndcg90=0.0;Double avgndcg100=0.0; 
		
		HashMap <String, Integer> companyallproducts=new HashMap <String, Integer> ();
		Iterator <String> it = gth.keySet().iterator();
		while (it.hasNext())
		{
			String line=it.next();
	//		System.out.println(line);
			String companyname=line.split("\t")[0];
			if (companyallproducts.containsKey(companyname))
			{
				Integer num=companyallproducts.get(companyname);
				num=num+1;
				companyallproducts.remove(companyname);
				companyallproducts.put(companyname, num);
			}
			else
			{
				companyallproducts.put(companyname, 1);
			}
		}
		for (int t=0;t<files.length;t++)
		{
			boolean old=true;
			if (!files[t].toString().contains(evaluatefile)) continue;
			if (files[t].toString().contains("Sunoco")) continue;
			if (files[t].toString().contains("Marathon Oil")) continue;
			if (files[t].toString().contains("Conocophillips")) continue;
			if (files[t].toString().contains("Frontier Oil")) continue;
			if (files[t].toString().contains("Murphy Oil")) continue;
			if (files[t].toString().contains("Valero Energy Corporation")) continue;
			
			if (files[t].toString().contains("AOL")) old=false;
			if (files[t].toString().contains("Ask.com")) old=false;
			if (files[t].toString().contains("AT&T")) old=false;
			if (files[t].toString().contains("Costco")) old=false;
			if (files[t].toString().contains("DELL")) old=false;
			if (files[t].toString().contains("IBM")) old=false;
			if (files[t].toString().contains("National Iranian Oil Company")) old=false;
			if (files[t].toString().contains("PetroChina")) old=false;
			if (files[t].toString().contains("Saudi Aramco")) old=false;
			if (files[t].toString().contains("Symantec")) old=false;
			
			String content=Utils.readFile(files[t].toString());
	//		System.out.println(content);
			
			String [] lines=content.split("\n");
			Double p5=0.0;Double p10=0.0;Double p20=0.0;Double p30=0.0;Double p40=0.0;Double p50=0.0;Double p60=0.0;Double p70=0.0;Double p80=0.0;Double p90=0.0;Double p100=0.0;
	//		Double r5=0.0;Double r10=0.0;Double r20=0.0;Double r30=0.0;Double r40=0.0;Double r50=0.0;Double r60=0.0;Double r70=0.0;Double r80=0.0;Double r90=0.0;Double r100=0.0;
			Double dcg5=0.0;Double dcg10=0.0;Double dcg20=0.0;Double dcg30=0.0;Double dcg40=0.0;Double dcg50=0.0;Double dcg60=0.0;Double dcg70=0.0;Double dcg80=0.0;Double dcg90=0.0;Double dcg100=0.0;
			
	//		Double np5=0.0;Double np10=0.0;Double np20=0.0;Double np30=0.0;Double np40=0.0;Double np50=0.0;Double np60=0.0;Double np70=0.0;Double np80=0.0;Double np90=0.0;Double np100=0.0;
	//		Double nr5=0.0;Double nr10=0.0;Double nr20=0.0;Double nr30=0.0;Double nr40=0.0;Double nr50=0.0;Double nr60=0.0;Double nr70=0.0;Double nr80=0.0;Double nr90=0.0;Double nr100=0.0;
	//		Double ndcg5=0.0;Double ndcg10=0.0;Double ndcg20=0.0;Double ndcg30=0.0;Double ndcg40=0.0;Double ndcg50=0.0;Double ndcg60=0.0;Double ndcg70=0.0;Double ndcg80=0.0;Double ndcg90=0.0;Double ndcg100=0.0;
			
	//		Double op5=0.0;Double op10=0.0;Double op20=0.0;Double op30=0.0;Double op40=0.0;Double op50=0.0;Double op60=0.0;Double op70=0.0;Double op80=0.0;Double op90=0.0;Double op100=0.0;
	//		Double or5=0.0;Double or10=0.0;Double or20=0.0;Double or30=0.0;Double or40=0.0;Double or50=0.0;Double or60=0.0;Double or70=0.0;Double or80=0.0;Double or90=0.0;Double or100=0.0;
	//		Double odcg5=0.0;Double odcg10=0.0;Double odcg20=0.0;Double odcg30=0.0;Double odcg40=0.0;Double odcg50=0.0;Double odcg60=0.0;Double odcg70=0.0;Double odcg80=0.0;Double odcg90=0.0;Double odcg100=0.0;

			for (int i=0;i<lines.length;i++)
			{
				if (lines[i].length()<1) continue;
				String term=lines[i].split("\t")[0]+"\t"+lines[i].split("\t")[1];
			
				if (gth.containsKey(term))
				{
					Double s=gth.get(term)/i;
					if (i<=5) 	{p5=p5+1;dcg5=dcg5+s;}
					if (i<=10)	{p10=p10+1;dcg10=dcg10+s; }
					if (i<=20)	{p20=p20+1;dcg20=dcg20+s; }
					if (i<=30)	{p30=p30+1;dcg30=dcg30+s; }
					if (i<=40)	{p40=p40+1;dcg40=dcg40+s;}
					if (i<=50)	{p50=p50+1;dcg50=dcg50+s; }
					if (i<=60)	{p60=p60+1;dcg60=dcg60+s; }
					if (i<=70)	{p70=p70+1;dcg70=dcg70+s; }
					if (i<=80)	{p80=p80+1;dcg80=dcg80+s; }
					if (i<=90)	{p90=p90+1;dcg90=dcg90+s; }
					if (i<=100) {p100=p100+1;dcg100=dcg100+s;}
				}else
				{
		//			System.out.println(term);
				}
			}
			String companyname=files[t].toString().substring(66).replace(evaluatefile, "");
			Integer productnum=companyallproducts.get(companyname);
			if (companyallproducts.containsKey(companyname))
			{
				System.out.println(companyname+
						"\t\t"+p5/5+"\t"+p10/10+"\t"+p20/20+"\t"+p30/30+"\t"+p40/40+"\t"+p50/50+"\t"+p60/60+"\t"+p70/70+"\t"+p80/80+"\t"+p90/90+"\t"+p100/100+
						"\t\t"+p5/productnum+"\t"+p10/productnum+"\t"+p20/productnum+"\t"+p30/productnum+"\t"+p40/productnum+"\t"+p50/productnum+"\t"+p60/productnum+"\t"+p70/productnum+"\t"+p80/productnum+"\t"+p90/productnum+"\t"+p100/productnum+
						"\t\t"+dcg5+"\t"+dcg10+"\t"+dcg20+"\t"+dcg30+"\t"+dcg40+"\t"+dcg50+"\t"+dcg60+"\t"+dcg70+"\t"+dcg80+"\t"+dcg90+"\t"+dcg100);
			}
			
			allp5=allp5+p5/5;allp10=allp10+p10/10;allp20=allp20+p20/20;allp30=allp30+p30/30;allp40=allp40+p40/40;allp50=allp50+p50/50;
				allp60=allp60+p60/60;allp70=allp70+p70/70;allp80=allp80+p80/80;allp90=allp90+p90/90;allp100=allp100+p100/100;
			
			alldcg5=alldcg5+dcg5;alldcg10=alldcg10+dcg10;alldcg20=alldcg20+dcg20;alldcg30=alldcg30+dcg30;alldcg40=alldcg40+dcg40;alldcg50=alldcg50+dcg50;
				alldcg60=alldcg60+dcg60;alldcg70=alldcg70+dcg70;alldcg80=alldcg80+dcg80;alldcg90=alldcg90+dcg90;alldcg100=alldcg100+dcg100;
			
			if (old)
			{
				allop5=allop5+p5/5;allop10=allop10+p10/10;allop20=allop20+p20/20;allop30=allop30+p30/30;allop40=allop40+p40/40;allop50=allop50+p50/50;
					allop60=allop60+p60/60;allop70=allop70+p70/70;allop80=allop80+p80/80;allop90=allop90+p90/90;allop100=allop100+p100/100;
				allodcg5=allodcg5+dcg5;allodcg10=allodcg10+dcg10;allodcg20=allodcg20+dcg20;allodcg30=allodcg30+dcg30;allodcg40=allodcg40+dcg40;allodcg50=allodcg50+dcg50;
					allodcg60=allodcg60+dcg60;allodcg70=allodcg70+dcg70;allodcg80=allodcg80+dcg80;allodcg90=allodcg90+dcg90;allodcg100=allodcg100+dcg100;
				allor5=allor5+p5/productnum;allor10=allor10+p10/productnum;allor20=allor20+p20/productnum;allor30=allor30+p30/productnum;allor40=allor40+p40/productnum;
					allor50=allor50+p50/productnum;allor60=allor60+p60/productnum;allor70=allor70+p70/productnum;allor80=allor80+p80/productnum;
					allor90=allor90+p90/productnum;allor100=allor100+p100/productnum;	

			}else{
				allnp5=allnp5+p5/5;allnp10=allnp10+p10/10;allnp20=allnp20+p20/20;allnp30=allnp30+p30/30;allnp40=allnp40+p40/40;allnp50=allnp50+p50/50;
					allnp60=allnp60+p60/60;allnp70=allnp70+p70/70;allnp80=allnp80+p80/80;allnp90=allnp90+p90/90;allnp100=allnp100+p100/100;
				allndcg5=allndcg5+dcg5;allndcg10=allndcg10+dcg10;allndcg20=allndcg20+dcg20;allndcg30=allndcg30+dcg30;allndcg40=allndcg40+dcg40;allndcg50=allndcg50+dcg50;
					allndcg60=allndcg60+dcg60;allndcg70=allndcg70+dcg70;allndcg80=allndcg80+dcg80;allndcg90=allndcg90+dcg90;allndcg100=allndcg100+dcg100;
				allnr5=allnr5+p5/productnum;allnr10=allnr10+p10/productnum;allnr20=allnr20+p20/productnum;allnr30=allnr30+p30/productnum;allnr40=allnr40+p40/productnum;
					allnr50=allnr50+p50/productnum;allnr60=allnr60+p60/productnum;allnr70=allnr70+p70/productnum;allnr80=allnr80+p80/productnum;
					allnr90=allnr90+p90/productnum;allnr100=allnr100+p100/productnum;	
			}
			
			allr5=allr5+p5/productnum;allr10=allr10+p10/productnum;allr20=allr20+p20/productnum;allr30=allr30+p30/productnum;allr40=allr40+p40/productnum;
			allr50=allr50+p50/productnum;allr60=allr60+p60/productnum;allr70=allr70+p70/productnum;allr80=allr80+p80/productnum;
			allr90=allr90+p90/productnum;allr100=allr100+p100/productnum;
		}
		
		avgp5=allp5/25;avgp10=allp10/25;avgp20=allp20/25;avgp30=allp30/25;avgp40=allp40/25;avgp50=allp50/25;avgp60=allp60/25;avgp70=allp70/25;avgp80=allp80/25;avgp90=allp90/25;avgp100=allp100/25;
		avgop5=allop5/15;avgop10=allop10/15;avgop20=allop20/15;avgop30=allop30/15;avgop40=allop40/15;avgop50=allop50/15;avgop60=allop60/15;
			avgop70=allop70/15;avgop80=allop80/15;avgop90=allop90/15;avgop100=allop100/15;
		avgnp5=allnp5/10;avgnp10=allnp10/10;avgnp20=allnp20/10;avgnp30=allnp30/10;avgnp40=allnp40/10;avgnp50=allnp50/10;avgnp60=allnp60/10;avgnp70=allnp70/10;
			avgnp80=allnp80/10;avgnp90=allnp90/10;avgnp100=allnp100/10;
				
		avgr5=allr5/25;avgr10=allr10/25;avgr20=allr20/25;avgr30=allr30/25;avgr40=allr40/25;avgr50=allr50/25;avgr60=allr60/25;avgr70=allr70/25;avgr80=allr80/25;avgr90=allr90/25;avgr100=allr100/25;
		avgor5=allor5/15;avgor10=allor10/15;avgor20=allor20/15;avgor30=allor30/15;avgor40=allor40/15;avgor50=allor50/15;avgor60=allor60/15;avgor70=allor70/15;
			avgor80=allor80/15;avgor90=allor90/15;avgor100=allor100/15;
		avgnr5=allnr5/10;avgnr10=allnr10/10;avgnr20=allnr20/10;avgnr30=allnr30/10;avgnr40=allnr40/10;avgnr50=allnr50/10;avgnr60=allnr60/10;avgnr70=allnr70/10;
			avgnr80=allnr80/10;avgnr90=allnr90/10;avgnr100=allnr100/10;
			
		avgdcg5=alldcg5/25;avgdcg10=alldcg10/25;avgdcg20=alldcg20/25;avgdcg30=alldcg30/25;avgdcg40=alldcg40/25;avgdcg50=alldcg50/25;avgdcg60=alldcg60/25;avgdcg70=alldcg70/25;avgdcg80=alldcg80/25;avgdcg90=alldcg90/25;avgdcg100=alldcg100/25;
		avgodcg5=allodcg5/15;avgodcg10=allodcg10/15;avgodcg20=allodcg20/15;avgodcg30=allodcg30/15;avgodcg40=allodcg40/15;avgodcg50=allodcg50/15;avgodcg60=allodcg60/15;avgodcg70=allodcg70/15;
				avgodcg80=allodcg80/15;avgodcg90=allodcg90/15;avgodcg100=allodcg100/15;
		avgndcg5=allndcg5/10;avgndcg10=allndcg10/10;avgndcg20=allndcg20/10;avgndcg30=allndcg30/10;avgndcg40=allndcg40/10;avgndcg50=allndcg50/10;avgndcg60=allndcg60/10;avgndcg70=allndcg70/10;
				avgndcg80=allndcg80/10;avgndcg90=allndcg90/10;avgndcg100=allndcg100/10;
				
		System.out.println("content \t\t 5 \t 10 \t 20\t30\t40\t50\t60\t70\t80\t90\t100\t\t5 \t 10 \t 20\t30\t40\t50\t60\t70\t80\t90\t100\t\t5 \t 10 \t 20\t30\t40\t50\t60\t70\t80\t90\t100\t");
		System.out.println("sum up all precisions"+"\t\t"+allp5+"\t"+allp10+"\t"+allp20+"\t"+allp30+"\t"+allp40+"\t"+allp50+"\t"+allp60+"\t"+allp70+"\t"+allp80+"\t"+allp90+"\t"+allp100+"\t"+
				"sum up all recalls"+"\t"+allr5+"\t"+allr10+"\t"+allr20+"\t"+allr30+"\t"+allr40+"\t"+allr50+"\t"+allr60+"\t"+allr70+"\t"+allr80+"\t"+allr90+"\t"+allr100+"\t"+
				"sum up all DCGs"+"\t"+alldcg5+"\t"+alldcg10+"\t"+alldcg20+"\t"+alldcg30+"\t"+alldcg40+"\t"+alldcg50+"\t"+alldcg60+"\t"+alldcg70+"\t"+alldcg80+"\t"+alldcg90+"\t"+alldcg100);
		System.out.println("sum up all old doc precisions"+"\t\t"+allop5+"\t"+allop10+"\t"+allop20+"\t"+allop30+"\t"+allop40+"\t"+allop50+"\t"+allop60+"\t"+allop70+"\t"+allop80+"\t"+allop90+"\t"+allop100+"\t"+
				"sum up all old doc recalls"+"\t"+allor5+"\t"+allor10+"\t"+allor20+"\t"+allor30+"\t"+allor40+"\t"+allor50+"\t"+allor60+"\t"+allor70+"\t"+allor80+"\t"+allor90+"\t"+allor100+"\t"+
				"sum up all old doc DCGs"+"\t"+allodcg5+"\t"+allodcg10+"\t"+allodcg20+"\t"+allodcg30+"\t"+allodcg40+"\t"+allodcg50+"\t"+allodcg60+"\t"+allodcg70+"\t"+allodcg80+"\t"+allodcg90+"\t"+allodcg100+"\t"	);
		System.out.println("sum up all new doc precisions"+"\t\t"+allnp5+"\t"+allnp10+"\t"+allnp20+"\t"+allnp30+"\t"+allnp40+"\t"+allnp50+"\t"+allnp60+"\t"+allnp70+"\t"+allnp80+"\t"+allnp90+"\t"+allnp100+"\t"+
				"sum up all new doc recalls"+"\t"+allnr5+"\t"+allnr10+"\t"+allnr20+"\t"+allnr30+"\t"+allnr40+"\t"+allnr50+"\t"+allnr60+"\t"+allnr70+"\t"+allnr80+"\t"+allnr90+"\t"+allnr100+"\t"+
				"sum up all new doc DCGs"+"\t"+allndcg5+"\t"+allndcg10+"\t"+allndcg20+"\t"+allndcg30+"\t"+allndcg40+"\t"+allndcg50+"\t"+allndcg60+"\t"+allndcg70+"\t"+allndcg80+"\t"+allndcg90+"\t"+allndcg100+"\t"	);
		
				
		System.out.println("average overall precisions"+"\t\t"+avgp5+"\t"+avgp10+"\t"+avgp20+"\t"+avgp30+"\t"+avgp40+"\t"+avgp50+"\t"+avgp60+"\t"+avgp70+"\t"+avgp80+"\t"+avgp90+"\t"+avgp100+"\t"+
				"average overall recalls"+"\t"+avgr5+"\t"+avgr10+"\t"+avgr20+"\t"+avgr30+"\t"+avgr40+"\t"+avgr50+"\t"+avgr60+"\t"+avgr70+"\t"+avgr80+"\t"+avgr90+"\t"+avgr100+"\t"+
				"average overall DCGs"+"\t"+avgdcg5+"\t"+avgdcg10+"\t"+avgdcg20+"\t"+avgdcg30+"\t"+avgdcg40+"\t"+avgdcg50+"\t"+avgdcg60+"\t"+avgdcg70+"\t"+avgdcg80+"\t"+avgdcg90+"\t"+avgdcg100);
		System.out.println("average overall old doc precisions"+"\t\t"+avgop5+"\t"+avgop10+"\t"+avgop20+"\t"+avgop30+"\t"+avgop40+"\t"+avgop50+"\t"+avgop60+"\t"+avgop70+"\t"+avgop80+"\t"+avgop90+"\t"+avgop100+"\t"+
				"average overall old doc recalls"+"\t"+avgor5+"\t"+avgor10+"\t"+avgor20+"\t"+avgor30+"\t"+avgor40+"\t"+avgor50+"\t"+avgor60+"\t"+avgor70+"\t"+avgor80+"\t"+avgor90+"\t"+avgor100+"\t"+
				"average overall old doc DCGs"+"\t"+avgodcg5+"\t"+avgodcg10+"\t"+avgodcg20+"\t"+avgodcg30+"\t"+avgodcg40+"\t"+avgodcg50+"\t"+avgodcg60+"\t"+avgodcg70+"\t"+avgodcg80+"\t"+avgodcg90+"\t"+avgodcg100+"\t");
		System.out.println("average overall new doc precisions"+"\t\t"+avgnp5+"\t"+avgnp10+"\t"+avgnp20+"\t"+avgnp30+"\t"+avgnp40+"\t"+avgnp50+"\t"+avgnp60+"\t"+avgnp70+"\t"+avgnp80+"\t"+avgnp90+"\t"+avgnp100+"\t"+
				"average overall new doc recalls"+"\t"+avgnr5+"\t"+avgnr10+"\t"+avgnr20+"\t"+avgnr30+"\t"+avgnr40+"\t"+avgnr50+"\t"+avgnr60+"\t"+avgnr70+"\t"+avgnr80+"\t"+avgnr90+"\t"+avgnr100+"\t"+
				"average overall new doc DCGS"+"\t"+avgndcg5+"\t"+avgndcg10+"\t"+avgndcg20+"\t"+avgndcg30+"\t"+avgndcg40+"\t"+avgndcg50+"\t"+avgndcg60+"\t"+avgndcg70+"\t"+avgndcg80+"\t"+avgndcg90+"\t"+avgndcg100);

	}
}
